<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>菜单列表</title>
  <#include "../include/base.ftl">
 </head>
 <body>
  
  <table id="menu-list-box" class="easyui-datagrid" style="width:98%;height:650px;" toolbar="#menu-list-btn"
    title="菜单列表" iconCls="icon-save" url="menu/list_data" singleSelect=true
    rownumbers="true" pagination="true" pageSize=10  pageList=[10,20,30,40,50]  pageNumber=1>
   <thead>
	    <tr>
	     	<th field="id" width="80" hidden=true>ID</th>
	     	<th field="menuName" width="150" formatter="formatMenuName">名称</th>
	     	<th field="parentName" width="150" formatter="formatParentMenu">上级菜单</th>
	     	<th field="menuCode" width="100" align="center">编号</th>
	     	<th field="menuUrl" width="200" align="left">URL</th>
	     	<th field="level" width="50" align="center">级別</th>
	     	<th field="sort" width="80" align="center">同级排序</th>
	     	<th field="createdTime" width="120" align="center">创建时间</th>
	     	<th field="editTime" width="120" align="center">修改时间</th>
	    </tr>
   </thead>
  </table>
  
  <div id="menu-list-btn" class="search-box">
	   <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:showAddBox();">添加</a>
	   <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="javascript:showEditBox();">编辑</a>
	   <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:deleteMenu();">刪除</a>
	   &nbsp;&nbsp;
	   <span class="search-label">菜单名称:</span>
	   <input id="menuName" class="easyui-textbox search-input">
	   <span class="search-label">编号:</span>
	   <input id="menuCode" class="easyui-textbox search-input">
	   <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch()">查询</a>
	   <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-reload" plain="true" onclick="resetSearchBox()">重置</a>
  </div>
  
  <div id="edit-menu-box" class="easyui-window add-box" title="菜单信息维护" style="width:550px;height:300px;display:none;left:200px;top:50px;background:#fafafa;"
          closed="true" modal="true" collapsible="false" minimizable="false" maximizable="false" draggable="false" resizable="false">  
      <form action="menu/save_menu" method="post" id="edit-menu-form" autocomplete="off">
			<table class="form-table">
				<tr>
					<th align="right" style="width: 65px">菜单名称:</th>
					<td><input type="text" id="editMenuName" name="menuName"
						class="easyui-textbox add-input" data-options="required:true">
						<input type="hidden" name="id" id="editId"> <font color="red">*</font>
					</td>
				</tr>
				<tr>
					<th align="right">上级菜单:</th>
					<td><input type="hidden" id="parentId" name="parent.id">
						<input type="text" id="parentName" name="parent.menuName"
						class="easyui-textbox add-input" readonly="readonly"> 
						<a class="easyui-linkbutton" iconCls="icon-search" plain="true"
						href="javascript:void(0);" onclick="loadMenuTreeList()">选择</a></td>
				</tr>
				<tr>
					<th align="right">菜单代码:</th>
					<td><input type="text" id="editMenuCode" name="menuCode"
						class="easyui-textbox add-input" data-options="required:true">
						<font color="red">*</font></td>
				</tr>
				<tr>
					<th align="right">菜单链接:</th>
					<td><input type="text" id="editMenuUrl" name="menuUrl"
						class="easyui-textbox add-input"></td>
				</tr>
				<tr>
					<th align="right">同级排序（修改）:</th>
					<td>
						<input type="text" id="editSort" name="sort" class="easyui-numberbox add-input" data-options="min:1,max:100">
						<span style="font-size:12px;color:red;">修改时使用，新增时编辑无效</span>
					</td>
				</tr>
				<tr>
					<th align="right">描述:</th>
					<td><input type="text" name="description" id="editDescription"
						style="width: 300px;" class="easyui-textbox add-input"
						data-options="multiline:true,resize:false"></td>
				</tr>
			</table>
			<br/>
       <div class="form-buttons">
        <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-ok" onclick="javascript:submitSaveMenu();">提交</a>
        &nbsp;&nbsp;&nbsp;
     <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#edit-menu-box').dialog('close');">关闭</a>
       </div>
      </form>  
  </div> 
  
  <div id="parentWin" class="easyui-window" title="上级菜单項选择" closed="true" modal="true" 
       collapsible="false" minimizable="false" maximizable="false" draggable="false" resizable="false"
       style="width:300px;height:460px;padding:5px;left:500px;top:80px;background: #fafafa;display:none;overflow-x:auto;overflow-y:auto" align="left">
   <ul id="menu-tree" class="easyui-tree" checkbox=false lines=true></ul>  
   <div style="margin-top:30px;"><a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-ok" onclick="setParent();">确定</a></div>
  </div>
  
  <script type="text/javascript" src="${request.contextPath}/style/web/js/portal-menu.js"></script>
 </body>
</html>
